<template>
  <div class="preview-fade">
    <div class="preview">
      <img src="../../img/close_icon.png" @click="close" class="close-preview">
      <div class="preview-center">

        <div class="preview-content">
          <div class="preview-top">
            <p>新闻详情</p>
          </div>
          <div class="pc-box">
            <div class="pc-scroll">
              <div class='article-tit'>{{priviewObject.title}}</div>
              <div class='article-info'>
                <span class='author'>{{priviewObject.author}}</span>
                <span class='dot'>·</span>
                <span class='time'>{{priviewObject.published_time}}</span>
                <span class='from'>{{priviewObject.source}}</span>
              </div>
              <div class="detail" v-html="priviewObject.newsDetail"></div>
            </div>
          </div>
        </div>
      </div>
    </div>

  </div>
</template>
<script>
export default {
  data () {
    return {}
  },
  props: {
    priviewObject: {
      type: Object
    }
  },
  methods: {
    close () {
      this.$emit('isCloseView', false)
    }
  }
}
</script>
<style>
.preview-fade {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  right: 0;
  overflow: auto;
  margin: 0;
  background-color: rgba(0, 0, 0, 0.3);
  z-index: 9999;
}
.preview {
  width: 435px;
  height: 888px;
  position: absolute;
  left: 50%;
  top: 15%;
  transform: translateX(-50%);
  border-radius: 2px;
  box-sizing: border-box;
  margin-bottom: 50px;
  background-image: url(../../img/mobile.png);
  background-repeat: no-repeat;
  background-size: cover;
}
.preview-center {
  width: 375px;
  height: 667px;
  padding-top: 114px;
  padding-left: 30px;
}
.preview-content {
  background: #fdfdfd;
  width: 375px;
  height: 667px;
}
.preview .close-preview {
  position: absolute;
  right: -27px;
  top: 1px;
  width: 25px;
  height: 25px;
}
.preview-top {
  width: 100%;
  height: 64px;
  background-image: url(../../img/preview-top.jpg);
  background-size: 100%;
  background-repeat: no-repeat;
}
.preview-top p {
  display: block;
  font-size: 17px;
  color: #000;
  width: 60%;
  padding-left: 20%;
  padding-top: 30px;
  text-align: center;
}
.preview-content .article-tit {
  font-size:19px;
  color:#141414;
  line-height:29px;
}
.preview-content .article-info {
  line-height:20px;
  padding:12px 0;
}
.preview-content .article-info .author {
  font-size:13px;
  color:#888;
}
.preview-content .article-info .dot {
  color:#888;
  line-height:20px;
  margin:0 6px;
}
.preview-content .article-info .time {
  font-size:13px;
  color:#888;
  margin-right:15px;
}
.preview-content .article-info .from {
  font-size:13px;
  color:#8148f8;
  /* margin-left:15px; */
}
.preview-content .detail{
  font-size: 15px;
  line-height: 1.6;
}
.preview-content .detail img {
  max-width: 100%;
  padding: 8px 0;
}
.preview-content .detail ul, .preview-content .detail ol {
  padding: 4px 0;
}
.preview-content .detail pre {
    margin-bottom: 6px;
    margin-top: 6px;
    padding: 4px 15px;
    background: #000;
    color: #fff;
    white-space: normal;
}
.preview-content .detail blockquote {
    border-left: 3px solid #ccc;
    margin: 5px 0;
    padding: 7px;
    background: #f5f5f5;
}
.preview-content .detail p, .preview-content .detail h1, .preview-content .detail h2{
  padding: 4px 0;
}
.preview-content .detail li {
  padding: 2px 0;
}
.pc-box {
  position: relative;
  padding: 10px 15px;
  height: 603px;
  overflow: auto;
  box-sizing: border-box;
}
.ql-align-center {
  text-align: center
}
.ql-align-right {
  text-align: right;
}
.detail .ql-align-justify {
    text-align: justify;
}
.detail .ql-size-small {
  font-size: 0.75em;
}
.detail .ql-size-large {
  font-size: 1.5em;
}
.detail .ql-size-huge {
  font-size: 2.5em;
}
</style>
